﻿using System;
using System.Collections.Generic;
using Character;
using UnityEngine;

// Token: 0x0200023B RID: 571
public class H_VisitorExpression : MonoBehaviour
{
	// Token: 0x06000F76 RID: 3958 RVA: 0x00062ABC File Offset: 0x00060CBC
	public void Setup()
	{
		H_VisitorExpression.Setup_Dictionary(this.eyeDic, this.eyeList);
		H_VisitorExpression.Setup_Dictionary(this.mouthDic, this.mouthList);
		for (int i = 0; i < 4; i++)
		{
			this.datas[i] = new H_VisitorExpressionData(this, this.expressionList[i]);
		}
	}

	// Token: 0x06000F77 RID: 3959 RVA: 0x00062B14 File Offset: 0x00060D14
	public string EyeName(string name)
	{
		if (this.eyeDic.ContainsKey(name))
		{
			return this.eyeDic[name];
		}
		GlobalData.Debug_LogError("眼睛的表情：" + name + " 找不到");
		return "Eye_Def";
	}

	// Token: 0x06000F78 RID: 3960 RVA: 0x00062B50 File Offset: 0x00060D50
	public string MouthName(string name)
	{
		if (this.mouthDic.ContainsKey(name))
		{
			return this.mouthDic[name];
		}
		GlobalData.Debug_LogError("嘴巴的表情：" + name + " 找不到");
		return "Mouth_Def";
	}

	// Token: 0x06000F79 RID: 3961 RVA: 0x00062B8C File Offset: 0x00060D8C
	private static void Setup_Dictionary(Dictionary<string, string> dic, TextAsset text)
	{
		CustomDataListLoader customDataListLoader = new CustomDataListLoader();
		customDataListLoader.Load(text);
		int attributeNo = customDataListLoader.GetAttributeNo("anime");
		int attributeNo2 = customDataListLoader.GetAttributeNo("name");
		for (int i = 0; i < customDataListLoader.GetDataNum(); i++)
		{
			string data = customDataListLoader.GetData(attributeNo, i);
			string data2 = customDataListLoader.GetData(attributeNo2, i);
			dic.Add(data2, data);
		}
	}

	// Token: 0x06000F7A RID: 3962 RVA: 0x00062BF4 File Offset: 0x00060DF4
	public H_VisitorExpressionData.Data ChangeExpression(Human human, string voiceFile)
	{
		if (!this.isUpdate)
		{
			return null;
		}
		if (human.sex == SEX.FEMALE)
		{
			Female female = human as Female;
			return this.datas[(int)female.HeroineID].ChangeExpression(human, voiceFile, this.duration);
		}
		return null;
	}

	// Token: 0x06000F7B RID: 3963 RVA: 0x00062C3C File Offset: 0x00060E3C
	public H_VisitorExpressionData.Data ChangeExpression(Human human, H_VisitorExpression.TYPE type)
	{
		if (!this.isUpdate)
		{
			return null;
		}
		if (human.sex == SEX.FEMALE)
		{
			Female female = human as Female;
			return this.datas[(int)female.HeroineID].ChangeExpression(human, type, this.duration);
		}
		return null;
	}

	// Token: 0x04001052 RID: 4178
	[SerializeField]
	private TextAsset[] expressionList = new TextAsset[4];

	// Token: 0x04001053 RID: 4179
	private H_VisitorExpressionData[] datas = new H_VisitorExpressionData[4];

	// Token: 0x04001054 RID: 4180
	[SerializeField]
	private TextAsset eyeList;

	// Token: 0x04001055 RID: 4181
	[SerializeField]
	private TextAsset mouthList;

	// Token: 0x04001056 RID: 4182
	[SerializeField]
	private float duration = 0.2f;

	// Token: 0x04001057 RID: 4183
	private Dictionary<string, string> eyeDic = new Dictionary<string, string>();

	// Token: 0x04001058 RID: 4184
	private Dictionary<string, string> mouthDic = new Dictionary<string, string>();

	// Token: 0x04001059 RID: 4185
	[SerializeField]
	private bool isUpdate = true;

	// Token: 0x0200023C RID: 572
	public enum STATE
	{
		// Token: 0x0400105B RID: 4187
		RESIST = 1,
		// Token: 0x0400105C RID: 4188
		FLIP
	}

	// Token: 0x0200023D RID: 573
	public enum TYPE
	{
		// Token: 0x0400105E RID: 4190
		BREATH,
		// Token: 0x0400105F RID: 4191
		TALK,
		// Token: 0x04001060 RID: 4192
		NUM
	}
}
